package yaner.hotel.manager.api.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import yaner.hotel.manager.api.dto.OrderDto;
import yaner.hotel.manager.api.service.OrderService;

@RestController
public class ApiController {

    private final OrderService orderService;
    public ApiController(OrderService orderService) {
        this.orderService = orderService;
    }

    @PostMapping
    public String sendMessage(@RequestBody OrderDto orderDto){
        orderService.syncPlaceOrder(orderDto);
        orderService.placeOrder(orderDto);
        return "下单成功";
    }
}
